#include "mysql_pool.h"
#include "test_mapper.h"

#include <iostream>

int main(int argc, char *argv[])
{
    MySQLPool  pool("127.0.0.1", 3306, "develop", "password", "test_database", 4);
    TestMapper testMapper(&pool);

    TestModel data = {.name = "test"};
    testMapper.createTable();
    for (int i = 0; i < 10; i++) {
        uint64_t id = testMapper.insertTest(data);
        std::cout << "insert test data, id: " << id << std::endl;
    }

    std::vector<TestModel> models = testMapper.findTestAll();
    for (auto &model : models) {
        std::cout << "find test data, id: " << model.id << ", name: " << model.name << std::endl;
    }
    testMapper.dropTable();

    return 0;
}